#include "stdafx.h"
#include "Graph.h"
#include <iostream>

void printVertexList(vector<uint> v) {
		for(vector<uint>::iterator it = v.begin(); it != v.end(); ++it) {
			cout<<*it<<" ";
		}
}

int _tmain(int argc, _TCHAR* argv[])
{
	Graph g;
	int vert;
	int vert2;
	if(g.readGraph("graph1.txt"))
		cout<<"Graph read successfuly\n";
	else
		cout<<"Fuck! Graph read Failed!\n";

	// cout<<g.getEdge(2,1)->toString();
	cout<<endl;
	while(1) {
		cout<<"Vertex: "; cin>> vert;
		cout<<"Cost: "<<g.getCost(vert, vert); cout<<endl;
		cout<<"Out degree: "<<g.getOutDegree(vert); cout<<endl;
		cout<<"In degree: "<< g.getInDegree(vert); cout<<endl;
		
		cout<<"List of outbound vertices for "<< vert <<": ";
		vector<uint> v = g.iterateOut(vert);
		printVertexList(v);
		cout<<endl;

		cout<<"List of inbound vertices for "<< vert <<": ";
		v = g.iterateIn(vert);
		printVertexList(v);
		cout<<endl;
		
		cout<<"Give two vertices: \n"; 
		cout<<"v1: "; cin>>vert; 
		cout<<"v2: "; cin>>vert2;
		v = g.BFS(vert, vert2);
		cout<<"Path from "<<vert<<" to "<<vert2<<": ";
		printVertexList(v);
		cout<<endl;
	}
	cout<<endl; system("pause"); 
	return 0;
}